package com.dcy.log.biz.controller;

import com.dcy.common.model.R;
import com.dcy.es.dto.PageResultOutputDTO;
import com.dcy.log.biz.dto.input.SearchInputDTO;
import com.dcy.log.biz.dto.output.ConsoleLog;
import com.dcy.log.biz.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：dcy
 * @Description:
 * @Date: 2020/10/9 15:34
 */
@RestController
@RequestMapping("/log")
@Api(value = "LogController", tags = {"日志操作接口"})
public class LogController {

    @Autowired
    private LogService logService;

    @ApiOperation(value = "获取业务日志分页查询", notes = "获取业务日志分页查询")
    @GetMapping("/getBusinessLogPageList")
    protected R<PageResultOutputDTO<ConsoleLog>> getBusinessLogPageList(SearchInputDTO searchInputDTO) {
        return R.success(logService.getBusinessLogPageList(searchInputDTO));
    }

    @ApiOperation(value = "获取登录登出日志分页查询", notes = "获取登录登出日志分页查询")
    @GetMapping("/getLoginLogPageList")
    protected R<PageResultOutputDTO<ConsoleLog>> getLoginLogPageList(SearchInputDTO searchInputDTO) {
        return R.success(logService.getLoginLogPageList(searchInputDTO));
    }
}
